package com.ysfxt.auth;


import com.ysfxt.model.SysTeacher;
import com.ysfxt.model.SysUser;

/**
 * @author 盐酸氟西汀
 * @create 2024/1/25 16:12
 * @email 480738950@qq.com
 */
public class AuthContextHolder {
    
    //普通用户id
    private static ThreadLocal<Long> userId = new ThreadLocal<Long>();
    
    //普通用户基本信息
    private static ThreadLocal<SysTeacher> userLogin = new ThreadLocal<>();
    
    //后台管理用户id
    private static ThreadLocal<Long> adminId = new ThreadLocal<Long>();
    //管理员基本信息
    private static ThreadLocal<SysUser> adminLogin = new ThreadLocal<>();
    
    public static Long getTeacherId(){
        return userId.get();
    }
    
    public static void setTeacherId(Long _userId){
        userId.set(_userId);
    }
    
    
    
    
    
    public static SysTeacher getTeacherLoginVo() {
        return userLogin.get();
    }
    
    public static void setTeacherLoginVo(SysTeacher _userLoginVo) {
        userLogin.set(_userLoginVo);
    }
    
    public static Long getAdminId() {
        return adminId.get();
    }
    
    public static void setAdminId(Long _adminId) {
        adminId.set(_adminId);
    }
    
    public static SysUser getAdminLoginVo() {
        return adminLogin.get();
    }
    
    public static void setAdminLoginVo(SysUser _adminLoginVo) {
        adminLogin.set(_adminLoginVo);
    }
}